import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {AppComponent} from './app.component';
import {PaydetailComponent} from "./paydetail/paydetail.component";

const routes: Routes = [
  {path: '', component: AppComponent, data: { title: '这里是首页'},
  children: [
    { path: '', redirectTo: 'tabar/shop', pathMatch: 'full'},
    { path: 'tabar', loadChildren: () => import('./tab-bar/tab-bar.module').then( m => m.TabBarModule)},
    { path: 'login', loadChildren: () => import('./login/login.module').then(m => m.LoginModule)},
    { path: 'goodsdetails/:id', loadChildren: () => import('./goodsdetails/goodsdetails.module').then( m => m.GoodsdetailsModule)},
    { path: 'paydetail', loadChildren: () => import('./paydetail/paydetail.module').then( m => m.PaydetailModule)},
    { path: 'address', loadChildren: () => import('./paydetail/address/address.module').then( m => m.AddressModule)},
    ]
  }
  ];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
